import { Form, Input, Card, Switch } from '@/components/base';
import { Typography } from "@/components/typography";
import { Flex } from "@/components/flex";

const { Text } = Typography;

export function StockInfoForm() {
    return (
        <Card>
            <Text size={16} strong style={{ display: 'block', marginBottom: '16px' }}>
                库存信息
            </Text>

            <Flex vertical gap={16}>
                <Form.Item
                    label="库存数量"
                    name="stockQuantity"
                    style={{ width: '100%', padding: 0 }}
                    rules={[
                        { required: true, message: '请输入库存数量' },
                        { pattern: /^[0-9]+$/, message: '请输入有效的数量' }
                    ]}
                >
                    <Input type="number" placeholder="请输入库存数量" />
                </Form.Item>

                <Form.Item
                    label="预警数量"
                    name="warningQuantity"
                    style={{ width: '100%', padding: 0 }}
                    rules={[
                        { required: true, message: '请输入预警数量' },
                        { pattern: /^[0-9]+$/, message: '请输入有效的数量' }
                    ]}
                >
                    <Input type="number" placeholder="请输入预警数量" />
                </Form.Item>

                <Form.Item
                    label="是否推荐"
                    name="isRecommended"
                    style={{ width: '100%', padding: 0 }}
                    valuePropName="checked"
                >
                    <Switch />
                </Form.Item>
            </Flex>
        </Card>
    );
} 